﻿using Abp.EntityFrameworkCore;
using HCD.Entities;
using HCD.EntityCfg;
using Microsoft.EntityFrameworkCore;
using Toolbelt.ComponentModel.DataAnnotations;

namespace HCD.EntityFrameworkCore
{
    public class EnterpriseDbContext : AbpDbContext
    {
        public EnterpriseDbContext(DbContextOptions<EnterpriseDbContext> options)
            : base(options)
        {
        }

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            modelBuilder.ApplyConfiguration(new SimpleDictCfg());
            modelBuilder.ApplyConfiguration(new MdtOrderCfg());
            modelBuilder.ApplyConfiguration(new PatientPartingInfoCfg());            
            base.OnModelCreating(modelBuilder);
            modelBuilder.BuildIndexesFromAnnotations();
        }

        //Add DbSet properties for your entities...
        public virtual DbSet<SimpleDict> SimpleDict { get; set; }
        public virtual DbSet<LabelTypeDict>  LabelTypeDict { get; set; }
        public virtual DbSet<ManagePartingDict> ManagePartingDict { get; set; }
        public virtual DbSet<MdtGroupTypeDict> MdtGroupTypeDict { get; set; }
        public virtual DbSet<HcdMaster> HcdMaster { get; set; }
        public virtual DbSet<HcdMessage> HcdMessage { get; set; }
        public virtual DbSet<HcdPatLabels> HcdPatLabels { get; set; }
        public virtual DbSet<PatientPartingInfo> PatientPartingInfo { get; set; }
        public virtual DbSet<MdtComment> MdtComments { get; set; }
        public virtual DbSet<MdtGroup> MdtGroup { get; set; }
        public virtual DbSet<MdtGroupUser> MdtGroupUsers { get; set; }
        public virtual DbSet<MdtMaster> MdtMaster { get; set; }
        public virtual DbSet<MdtOrder> MdtOrders { get; set; }
        public virtual DbSet<UserScreening> UserScreening { get; set; }
        public virtual DbSet<UserScreeningDetail> UserScreeningDetail { get; set; }
        public virtual DbSet<HisOrders> HisOrders { get; set; }
        public virtual DbSet<HisOperation> HisOperation { get; set; }
        public virtual DbSet<HisExam> HisExam { get; set; }
        public virtual DbSet<HisExamReport> HisExamReport { get; set; }
        public virtual DbSet<HisLabTest> HisLabTest { get; set; }
        public virtual DbSet<HisLabResult> HisLabResult { get; set; }
        public virtual DbSet<HisGlucoseRec> HisGlucoseRec { get; set; }
        public virtual DbSet<HisResultAlarm> HisResultAlarm { get; set; }
        public virtual DbSet<UserEntity> User{get;set;}
    }
}